package com.project.myxima.data;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

import androidx.annotation.Nullable;

import static com.project.myxima.utils.Constants.DB_NAME;
import static com.project.myxima.utils.Constants.DB_VERSION;

public class ximalayaDBHelper extends SQLiteOpenHelper {
    public ximalayaDBHelper(Context context) {

        super(context, DB_NAME, null, DB_VERSION);
    }

    @Override
    public void onCreate(SQLiteDatabase db) {

        //cover ,description,playcount, trackCount, authorName, albumID
        String SubSql = String.format("create table SubTable(_id integer primary key autoincrement,coverUrl varchar,subTitle varchar,subDescription varchar,playCount integer, trackCount integer,authorName varcharalbumID integer);");

        //String sql = "create table person(id integer primary key autoincrement,name varchar(64),address varchar(64))";

        db.execSQL(SubSql);

        String sql = "insert into SubTable (subTitle,coverUrl) values ('carson','subTitle')";
        for (int i = 0; i < 100; i++) {
            db.execSQL(sql);
        }
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {

    }
}
